<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>接口调用说明</title>
<link rel="stylesheet" type="text/css" href="./css/mserver.css" />
<link rel="stylesheet" type="text/css" href="./css/calender.css" />
<link rel="stylesheet" type="text/css" href="./css/mserverother.css" />
<link rel="stylesheet" type="text/css" href="./css/tip-yellow.css" />
<link rel="stylesheet" type="text/css" href="./css/tip-darkgray.css" />
<link rel="stylesheet" type="text/css" href="./css/tableStyle.css" />
<script src="./js/jquery-1.8.0.min.js"></script>
<script src="./js/Common.js"></script>
</head>

<body>
    <div class="right">
        <div class="api_list">
            <h1>接口调用说明</h1>
            <ul>
                <li><a href="#113">调用原理</a></li>
                <li><a href="#114">使用语言</a></li>
                <li><a href="#115">调用入口</a></li>
                <li><a href="#116">调用参数</a></li>
            </ul>

        </div>
        <ul class="detail_list">
            <li style="padding-bottom: 20px;">
                <div class="title">
                    <h2><a name="113">调用原理</a></h2>
                    <a class="show" style="cursor: pointer;">[隐藏]</a>
                </div>
                <div class="theme_content" style="text-indent: 24px;">
                    <p>
                        用户按照云医通开放性接口平台API的规范拼装一个正确的URL，通过HTTP请求，就能够拿到用户自己需要的数据。
                    </p>
                </div>
            </li>
            <li style="padding-bottom: 20px;">
                <div class="title">
                    <h2><a name="114">使用语言</a></h2>
                    <a class="show" style="cursor: pointer;">[隐藏]</a>
                </div>
                <div class="theme_content" style="text-indent: 24px;">
                    <p>
                        云医通开放性接口平台 API (接口) 采用 REST 风格，只需将所需参数拼装成http请求，即可调用。故支持 https 协议请求的程序语言，均可调用云医通开放性接口平台API，例如php、C#、asp、java、delphi 等。
                    </p>
                </div>
            </li>
            <li style="padding-bottom: 20px;">
                <div class="title">
                    <h2><a name="115">调用入口</a></h2>
                    <a class="show" style="cursor: pointer;">[隐藏]</a>
                </div>
                <div class="theme_content" style="text-indent: 24px;">
                    <p>
                        环境地址，即调用接口(API)时，都通过访问该地址，来获取该接口需要获取的数据
                    </p>
                    <p>
                        正式环境：https://api.yunyichina.cn/openapi/rest
                    </p>
                    <p>
                       测试环境：https://testapi.yunyichina.cn/openapi/rest
                    </p>
                </div>
            </li>
            <li style="padding-bottom: 20px;">
                <div class="title">
                    <h2><a name="116">调用参数</a></h2>
                    <a class="show" style="cursor: pointer;">[隐藏]</a>
                </div>
                <div class="theme_content" style="text-indent: 24px;">
                    <p>
                        调用API ，必须传入系统参数和应用参数。系统参数是调用每个api时默认的必填参数；应用参数由于不同 API 各自不同，这里以<strong>yyt.base.user.resource.get</strong>为例说明，更多请参考API文档。
                    </p>
                    <p>
                        <strong>1. 系统级调用参数</strong>
                    </p>
                    <div>
                        <table width="100%" class="kindTable kindTable2" bordercolor="#ccdee8" border="1">
                            <tbody>
                                <tr class="blueBg">
                                    <th style="text-align: center;">
                                        <b><span style="color: black; font-family: 宋体; font-size: 9pt;">名称</span></b>
                                    </th>
                                    <th style="text-align: center;">
                                        <b><span style="color: black; font-family: 宋体; font-size: 9pt;">类型</span></b>
                                    </th>
                                    <th style="text-align: center;">
                                        <b><span style="color: black; font-family: 宋体; font-size: 9pt;">是否必须</span></b>
                                    </th>
                                    <th style="text-align: center;">
                                        <b><span style="color: black; font-family: 宋体; font-size: 9pt;">描述</span></b>
                                    </th>
                                </tr>
                                
                                  <tr class="blueBg">
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">appid</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">Y</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;分配给应用的appid，创建应用时可获得
                                        </p>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">method</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">Y</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;API接口名称
                                        </p>
                                    </td>
                                </tr>
                              
                                <tr>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">format</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            <span style="color: black; font-family: 宋体; font-size: 9pt;">Y</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;可选，指定响应格式。默认json,目前支持格式为json
                                        </p>
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">data</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">Y</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;json经过AES加密后，产生的urlsafe base64编码
                                        </p>
                                    </td>
                                </tr>
                              
                                <tr>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">v</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">Y</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;API协议版本，可选值：1000
                                        </p>
                                    </td>
                                </tr>
                             
                                
                                  <tr class="blueBg">
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">timestamp</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">Y</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;时间戳，10位
                                        </p>
                                    </td>
                                </tr>
                                
                                <tr class="blueBg">
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">session</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">Y</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="left">
                                            <br>
                                        </p>
                                        <div style="text-align: center;">
                                            &nbsp;分配给用户的SessionKey(或 Access Token），通过登陆授权获取，方法参考用户授权介绍。
                                        </div>
                                        <p>
                                            <br>
                                        </p>
                                    </td>
                                </tr>
                                
                                   <tr class="blueBg">
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">sign</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">Y</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;对API输入参数进行md5加密获得，详细参考签名sign
                                        </p>
                                    </td>
                                </tr>
                                
                                
                                 <tr class="blueBg">
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">callback</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">N</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;回调，jsonp用到
                                        </p>
                                    </td>
                                </tr>
                                
                                <tr class="blueBg">
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">redirectflag</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">integer</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">N</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;0-返回格式为text/plain  1-返回格式为text/html(数据跳转用到)
                                        </p>
                                    </td>
                                </tr>
                                
                            </tbody>
                        </table>
                    </div>
                    <p>
                        <br>
                    </p>
                    <p>
                        <strong>2. </strong><strong>应用参数</strong>
                    </p>
                    <p>
                        此处以<strong>yyt.base.user.resource.get</strong>接口为例，查看其他接口的应用参数请参照对应页面。
                    </p>
                    <div>
                        <table width="100%" class="kindTable kindTable2" bordercolor="#ccdee8" border="1">
                            <tbody>
                                <tr class="blueBg">
                                    <th style="text-align: center;">
                                        <b><span style="color: black; font-family: 宋体; font-size: 9pt;">名称</span></b>&nbsp;
                                    </th>
                                    <th style="text-align: center;">
                                        <b><span style="color: black; font-family: 宋体; font-size: 9pt;">类型</span></b>
                                    </th>
                                    <th style="text-align: center;">
                                        <b><span style="color: black; font-family: 宋体; font-size: 9pt;">是否必须</span></b>
                                    </th>
                                    <th style="text-align: center;">
                                        <b><span style="color: black; font-family: 宋体; font-size: 9pt;">描述</span></b>&nbsp;
                                    </th>
                                </tr>
                                <tr>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">loginname</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">Y</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">测试</span>
                                        </p>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">subsystem</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">Y</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">测试</span>
                                        </p>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">ostypeid</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">string</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">Y</span>
                                        </p>
                                    </td>
                                    <td>
                                        <p align="center" style="text-align: center;">
                                            &nbsp;<span style="color: black; font-family: 宋体; font-size: 9pt;">测试</span>
                                        </p>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <p>
                        <br>
                    </p>
                    <p>
                        <strong>3. </strong><strong>生成提交的data</strong>
                    </p>
                    <p>
                       {"userid":1001,"registername":"zhangsan"}
                    </p>
                    <p>
                    	利用AES加密后数据产生urlsafe base64编码(假如key为:c595c7c0b85a4379，key和session在用户调用yyt.base.user.login的时候即可获取到)
                    </p>
                    <p>
                    	<strong>密文的生成规则</strong>：将需要提交的json数据，以utf-8的编码方式转成byte数组，再用平台分配的key加密生成urlsafe base64的字符串
                    </p>
                    <p>
                    	<strong>关于urlsafe base64编码</strong>:我们有多个API中要求对参数进行base64编码，为了确保编码后的结果不会打断URI，我们采用urlsafe base64编码，它和普通base64编码的差别在于：将普通base64编码结果中的加号(+)替换成减号(-)，将斜杠(/)替换成下划线 (_);
                    </p>
                    <p>
                       	生成结果：01MywKEX5bPh6eRcZJ3nXPPkdHnwMC3uKHADhXz7CP8gW5ihuFBEZIxgepVzXxCl5vonWTKhGrAqab0hmkAR_A..
                    </p>
                    <p>
                        <strong>4. </strong><strong>生成签名的sign</strong>
                    </p>
                   	<p>
                   		取系统参数：appid+method+format+data+v+ timestamp + session+key  算一个32位小写的md5
                   	</p>
                   	<p>
                   	appid=1234567890900000
                   	</p>
                   		<p>
                   	method=yyt.base.user.resource.get
                   	</p>
                   		<p>
                   	format=json
                   	</p>
                   		<p>
                   	data=01MywKEX5bPh6eRcZJ3nXPPkdHnwMC3uKHADhXz7CP8gW5ihuFBEZIxgepVzXxCl5vonWTKhGrAqab0hmkAR_A..
                   	</p>
                   		<p>
                   	v=1010
                   	</p>
                   		<p>
                   	timestamp=1428459676
                   	</p>
                   		<p>
                   	session=69bb3b1eb9394cb6bb3b7a22707af237
                   	</p>
                   		<p>
                   	key=c595c7c0b85a4379
                   	</p>
                   	
                   	<p>
                   		取上面所有字符串：1234567890900000yyt.base.user.resource.getjson01MywKEX5bPh6eRcZJ3nXPPkdHnwMC3uKHADhXz7CP8gW5ihuFBEZIxgepVzXxCl5vonWTKhGrAqab0hmkAR_A==1010142845967669bb3b1eb9394cb6bb3b7a22707af237c595c7c0b85a4379
                   	</p>
                   	<p>
                   		算一个32位sign：0982e1ec092caa86d0aff87f9c21a2c9
                   	</p>
                   	
                   	  <p>
                        <strong>5. </strong><strong>生成提交的数据</strong>
                    </p>
                    <p>
                    	https://api.yunyichina.cn/openapi/rest?appid=1234567890900000&method=yxnp.base.user.getresource&format=json&data=01MywKEX5bPh6eRcZJ3nXPPkdHnwMC3uKHADhXz7CP8gW5ihuFBEZIxgepVzXxCl5vonWTKhGrAqab0hmkAR_A==&v=1010&timestamp=1428459676&session=69bb3b1eb9394cb6bb3b7a22707af237&sign=0982e1ec092caa86d0aff87f9c21a2c9
                    </p>
                    
                    <p>
                        <strong>6. </strong><strong>提交后返回的数据格式</strong>
                    </p>
                    
                    <p>
                   	 {"message":"获取数据成功","ret":0}
                    </p>
                   
                </div>
            </li>


        </ul>
    </div>

	<script type="text/javascript">
		$(function() {
			window.parent.Public.CurrentPage(this);
			window.parent.Public.ReSizeFrame();		

			$(".show").click(function() {
				Public.Fold(this);
			});
		});
	</script>
</body>
</html>